package me.cxlr.qinlauncher2.util;

import android.content.Context;

/**
 * @author 酷安用户:山轮纸
 */
public class DisplayUtil {

    private DisplayUtil() {

    }

    /**
     * dp dip 转为 px
     *
     * @param context 上下文
     * @param dpValue dp或dip
     * @return px
     */
    public static int dpToPx(Context context, float dpValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dpValue * scale + 0.5f);
    }
}
